<?php

namespace JsonLowCode\Form\Fields;

use JsonLowCode\UI\HiddenField as BaseHiddenField;
use JsonLowCode\Form\Abstract\FieldAbstract;

class HiddenField extends FieldAbstract
{
    protected array $style = ['display'=>'none !important'];
    protected function booting(): void
    {
        $this->element = new BaseHiddenField();
        $this->element->bindModel("value", $this->bindField);
        $this->hide();
    }

    public function show(): static
    {
        $this->formField->clearStyle();
        return $this;
    }

    public function hide(): static
    {
        $this->formField->styles($this->style);
        return $this;
    }
}
